<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:if test="${billType=='BUY'}">
	<c:set var="billTypeName" value="采购" />
</c:if>
<c:if test="${billType=='BACK'}">
	<c:set var="billTypeName" value="退货" />
</c:if>
<c:set var="pageTitle" value="${billTypeName}单关联单据" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<script src="/js/popup_ext.js"></script>
<script language="javascript">
	function doCopy(code){
		if(checkNavigator()[0]=="msie"){
			window.clipboardData.setData("Text",code);
			ShowAlert('提示框','复制成功！',200,100);
		}else{
			ShowAlert('提示框','对不起，当前浏览器不支持剪帖板功能！',200,100);
		}
	}
	function showPayBill(id){
		var url="/finance/PayBillEdit.ihtm?id="+id+"&alert_type=FORM";
		showWin(1024,600,url);
	}
	function showAdjustBill(id){
		var url="/finance/AdjustBillEdit.ihtm?id="+id+"&alert_type=FORM";
		showWin(1024,600,url);
	}
</script>
</head>
<body oncontextmenu="return false" class="sheet" style="text-align:center;">
<div class="sheet-main" style="width:860px;text-align:left;margin:auto;">
  <div class="sheet-top">
    <div class="content">
      <h2>${code}关联单据</h2>
      <p>与${billTypeName}单相关的单据，包括付款、调账等</p>
    </div>
  </div>
  <div class="sheet-list">
    <div class="search-business">
     <div class="table-list">
        <fieldset class="det_fieldset ">
     	<legend class="mag10">付款单</legend>
        <table width="98%" align="center">
           	<tr>
			   	<th  width="20%">付款单号</th>
				<th  width="20%">日期</th>
				<th  width="20%">开单人</th>
				<th  width="20%">状态</th>
				<th  width="20%">操作</th>
			</tr>
			<c:if test="${fn:length(payList)==0}">
			<tr>
				<td colspan="5">没有付款单</td>
			</tr>
			</c:if>
			<c:if test="${fn:length(payList)>0}">
			<c:forEach var="item" items="${payList}" varStatus="i">
				<tr>
					<td >${item.billCode}</td>
					<td ><fmt:formatDate value="${item.payDate}" pattern="yyyy-MM-dd"/></td>
					<td >${item.createrName}</td>
					<td >
						<c:if test="${item.examined=='N'}">未审核</c:if>
						<c:if test="${item.examined=='Y'}">已审核</c:if>
					</td>
					<td>
						<a href="javascript:doCopy('${item.billCode}');">复制单号</a>
						<c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';PAY_BILL_SEAR;')!=-1}"><a href="javascript:showPayBill(${item.id});">查看</a></c:if>
					</td>
				</tr>
			</c:forEach>
			</c:if>
		</table>
		</fieldset>
     </div>
     <div class="blank12"></div>
     
     <div class="table-list">
        <fieldset class="det_fieldset ">
     	<legend class="mag10">调帐单</legend>
        <table width="98%" align="center">
           	<tr>
			   	<th  width="20%">调账单号</th>
				<th  width="20%">日期</th>
				<th  width="20%">开单人</th>
				<th  width="20%">状态</th>
				<th  width="20%">操作</th>
			</tr>
			<c:if test="${fn:length(adjustList)==0}">
			<tr>
				<td colspan="5">没有调账单</td>
			</tr>
			</c:if>
			<c:if test="${fn:length(adjustList)>0}">
			<c:forEach var="item" items="${adjustList}" varStatus="i">
				<tr>
					<td >${item.billCode}</td>
					<td ><fmt:formatDate value="${item.adjustDate}" pattern="yyyy-MM-dd"/></td>
					<td >${item.createrName}</td>
					<td >
						<c:if test="${item.examined=='N'}">未审核</c:if>
						<c:if test="${item.examined=='Y'}">已审核</c:if>
					</td>
					<td>
						<a href="javascript:doCopy('${item.billCode}');">复制单号</a>
						<c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';ADJU_BILL_SEAR;')!=-1}"><a href="javascript:showAdjustBill(${item.id});">查看</a></c:if>
					</td>
				</tr>
			</c:forEach>
			</c:if>
		</table>
		</fieldset>
     </div>
    </div>
  </div>
</div>	
</body>
</html>